import base from './base.js';

export default function (url, data = {}, method = "GET") {
  return new Promise((resolve, reject) => {
    uni.request({
      // url: base.host + url,  //小程序请求
			url: base.host + url,
			// url, //h5的请求地址
      data,
      method,
      success: (res) => {
        resolve(res.data); // ✅ 返回接口真正的数据
      },
      fail: (err) => {
        reject(err);
      }
    });
  });
}